package behavioral_pattern.command_pattern.invoker;

import behavioral_pattern.command_pattern.comand.Command;

/*
 * @Author xuhj
 * @Description 可以看做是遥控器
 * @Date 9:41 下午 2022/1/12
 * @Param
 * @return
 **/
public class Control {
    private Command turnOn, turnOff,changeChannel;

    public Control(Command turnOn, Command turnOff, Command changeChannel) {
        this.turnOn = turnOn;
        this.turnOff = turnOff;
        this.changeChannel = changeChannel;
    }
    public void controlOn(){
        this.turnOn.execute();
    }
    public void controlOff(){
        this.turnOff.execute();;
    }
    public void controlChannel(){
        this.changeChannel.execute();
    }
}
